<?php

class Login extends Controller {

    public $error;

    public function __construct() {
        parent::__construct();
    }

    public function __destruct() {
        parent::__destruct();
    }

    public function index() {
	echo md5('vantai');
        if (isset($this->_session['user'])) {
            header('Location:index.php');
        }

        if (isset($this->_post["user"])) {
            $user = $this->_post["user"];
            $this->model('user');
            $this->error = $this->user->login($user['username'], $user['password']);
        }

        $this->template('login');
    }
}

?>
